package com.hx.regex.main;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by hx-pc on 17-2-7.
 */
public class RegexMain {

    public static void main(String args[]) {
        String regex = "^([1-9][0-9]*人/[0-9]+.[0-9]+天/[1-9][0-9]*家).+([1-9][0-9]*人/[0-9]+.[0-9]+天/[1-9][0-9]*家)$";
        Pattern pattern = Pattern.compile(regex);
        String text = "1人/0,5天/3家,asda3人/0.5天/3家";
        Matcher matcher = pattern.matcher(text);
        if(matcher.find()){
            System.out.println("找到了: " + matcher.group());
        }else{
            System.out.println("找不到");
        }
    }

}
